package com.gopay.common.exception.acctstat;

import com.gopay.common.constants.proccode.ProcCodeEnum;

/**
 * 账户状态 运行时异常
 * Created by lx on 2017/4/1.
 */
public class AcctStatRuntimeException extends RuntimeException {
    /**
     * 模块名，抛出异常的类
     */
    @SuppressWarnings("rawtypes")
    protected Class errClass = null;

    /**
     * 错误码
     */
    protected String errCode = null;

    /**
     * 错误描述信息
     */
    protected String errMsg = null;

    protected String debugMsg = null;

    public AcctStatRuntimeException(){
        super("no errMsg");
    };

    public AcctStatRuntimeException(String errCode){
        super("no errMsg");
        this.errCode = errCode;
    }

    public AcctStatRuntimeException(String errCode,String errMsg){
        super(errMsg);
        this.errCode = errCode;
        this.errMsg = errMsg;
    }

    public AcctStatRuntimeException(ProcCodeEnum procCodeEnum){
        super(procCodeEnum.getMsg());
        this.errCode = procCodeEnum.getCode();
        this.errMsg = procCodeEnum.getMsg();
    }

    public AcctStatRuntimeException(ProcCodeEnum procCodeEnum, String debugMsg) {
        super(procCodeEnum.getMsg()+"（"+debugMsg+"）");
        this.errCode = procCodeEnum.getCode();
        this.errMsg = procCodeEnum.getMsg();
        this.debugMsg = debugMsg;
    }

    public AcctStatRuntimeException(String errCode,String errMsg,Class errClass ){
        super(errMsg);
        this.errCode = errCode;
        this.errMsg = errMsg;
        this.errClass = errClass;
    }

    @SuppressWarnings("rawtypes")
    public Class getErrClass() {
        return errClass;
    }

    public String getErrCode() {
        return errCode;
    }

    public String getErrMsg() {
        return errMsg;
    }

    public String getDebugMsg() {
        return debugMsg;
    }
}
